#ifndef SYNTAX_TREE
#define SYNTAX_TREE

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "base.h"


typedef struct TreeNode {
    char *name;
    t_kind kind;
    t_types type;
    union {
		int inteiro;
		float real;
		char caracter;
		char *texto;
		int *outros;
	} value;
	int child_counter;
    struct TreeNode* parent;
    struct TreeNode* children;
    struct TreeNode* sibling;
}TreeNode;

typedef struct Visitor {
	void (**visitorFunction)(struct Visitor *visitor, struct TreeNode *node);
} Visitor;

struct TreeNode *tree_node_new(const char *name, t_kind kind);
void tree_node_add_child(struct TreeNode *, struct TreeNode *);
void tree_node_add_sibling(struct TreeNode *, struct TreeNode *);
void printTree(TreeNode *root);
void tree_node_accept(TreeNode *self, Visitor *visitor);
void tree_node_accept_children(TreeNode *self, Visitor *visitor);

TreeNode *root;

#endif // SYNTAX_TREE
